// 封装频道接口
import axios from '@/utils/request'
export const getUserChannels = () =>
  axios({
    url: '/v1_0/user/channels'
  })

export const getAllChannels = () =>
  axios({
    url: '/v1_0/channels'
  })

/**
 * 添加频道接口
 * @param {*} channels
 * @returns
 */
export const setUserChannels = (channels) =>
  axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })

/**
 * 删除频道
 * @param {*} target 用户频道id
 * @returns
 */
export const delUserChannels = (target) =>
  axios({
    method: 'DELETE',
    url: '/v1_0/user/channels/' + target
  })
